/**
 * 
 */
//5.0.1DatePicker bug
Ext.define('Bmc.picker.Date', {
	override: 'Ext.picker.Date',
	createMonthPicker: function() {
        var me = this,
            picker = me.monthPicker;

        if (!picker) {
            me.monthPicker = picker = new Ext.picker.Month({
                renderTo: me.el,
                floating: true,
                padding: me.padding,
                shadow: false,
                small: me.showToday === false,
                listeners: {
                    scope: me,
                    cancelclick: me.onCancelClick,
                    okclick: me.onOkClick,
                    yeardblclick: me.onOkClick,
                    monthdblclick: me.onOkClick
                }
            });
            
            //↓↓↓↓↓↓↓↓↓fix begin 替换getRefOwner方法
            picker.getRefOwner = function(){
            	return this.ownerCt || this.initOwnerCt || this.ownerCmp || this.floatParent || me;
            };
            //↑↑↑↑↑↑↑↑↑fix end 替换getRefOwner方法
            
            if (!me.disableAnim) {
                // hide the element if we're animating to prevent an initial flicker
                picker.el.setStyle('display', 'none');
            }
            picker.hide();
            me.on('beforehide', me.doHideMonthPicker, me);
        }
        return picker;
    }
});